package com.yanqu.road.entity.decoration;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.util.Objects;

public class MammonRecord extends DataObject {
    private String recordUid;
    private int type;
    private long userId;
    private UserBaseInfo userBaseInfo = new UserBaseInfo();
    private long recordTime;
    private int mammonIndex;
    private boolean isSendCross;

    public String getRecordUid() {
        return recordUid;
    }

    public void setRecordUid(String recordUid) {
        if(!Objects.equals(this.recordUid, recordUid)) {
            this.recordUid = recordUid;
            setUpdateOption();
        }
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        if(this.type != type) {
            this.type = type;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public UserBaseInfo getUserBaseInfo() {
        return userBaseInfo;
    }

    public String getUserBaseInfoJsonStr() {
        if(null == userBaseInfo){
            return "{}";
        }else {
            return JSON.toJSONString(userBaseInfo);
        }
    }

    public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
        this.userBaseInfo = userBaseInfo;
        setUpdateOption();
    }

    public long getRecordTime() {
        return recordTime;
    }

    public void setRecordTime(long recordTime) {
        if(this.recordTime != recordTime) {
            this.recordTime = recordTime;
            setUpdateOption();
        }
    }

    public boolean isSendCross() {
        return isSendCross;
    }

    public void setSendCross(boolean sendCross) {
        if(this.isSendCross != sendCross) {
            isSendCross = sendCross;
            setUpdateOption();
        }
    }

    public int getMammonIndex() {
        return mammonIndex;
    }

    public void setMammonIndex(int mammonIndex) {
        this.mammonIndex = mammonIndex;
    }
}
